/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import view.LoginPanel;

/**
 *
 * @author Ponzini, Nelson; Pioli, Pablo
 */
class ControladorLogin extends Controlador {

    // objeto panel
    private LoginPanel login;
    
    // constructor
    public ControladorLogin(JPanel _content) {
        
          this.login = (LoginPanel)_content;
         
    }
          
    // enum botones, acciones
    public enum Accion
    {
         BotonAceptar,
         BotonCancelar
    }
    
    
    @Override
    public void iniciar(){
        
//        this.login.BotonAceptar.setActionCommand( "BotonAceptar" );
//        this.login.BotonAceptar.addActionListener(this);
//        
//
//        this.login.BotonCancelar.setActionCommand( "BotonCancelar" );
//        this.login.BotonCancelar.addActionListener( this );
       
    }
    
    
    // configuraciones de acciones
    @Override
     public void actionPerformed(ActionEvent e) {

        switch ( ControladorLogin.Accion.valueOf( e.getActionCommand() ) )
        {
            case BotonAceptar:
                System.out.println("Boton Aceptar command recived!");
                break;
            case BotonCancelar:
               this.login.removeAll();
               this.login.updateUI();
                break;
        }//-> fin case
     }
}
